import request from "../utils/request";
export default {
    login(params,  mock = true) {
        return request({
            url: '/users/login',
            method: 'post',
            data: params,
            mock: mock
        })
    },

    getPendingCount(mock = true) {
        return request({
            url: '/leave/count',
            method: 'get',
            data: {},
            mock: mock
        })
    },

    getMenuList(params, mock = true) {
        return request({
            url: '/menu/list',
            method: 'get',
            data: params,
            mock: mock
        })
    },
    getPermission( mock = true) {
        return request({
            url: '/users/getPermissionList',
            method: 'get',
            data: {},
            mock: mock
        })
    },
    operateMenu(params, mock = false) {
        return request({
            url: '/menu/operate',
            method: 'post',
            data: params,
            mock: mock
        })
    },
    getUserList(params ,mock = true) {
        return request({
            url: '/users/list',
            method: 'get',
            data: params,
            mock: false
        })
    },
    getAllUser(mock = true) {
        return request({
            url: '/users/all/list',
            method: 'get',
            data: {},
            mock: true
        })
    },
    operateDept(params, mock = true) {
        return request({
            url: '/dept/operate',
            method: 'post',
            data: params,
            mock: mock
        })
    },
    userDelete(params ,mock = true) {
        return request({
            url: '/users/delete',
            method: 'delete',
            data: params,
            mock: false
        })
    },
    getAllRole(mock = true) {
        return request({
            url: '/roles/all',
            method: 'get',
            data: {},
            mock: mock
        })
    },
    getRoleList (params, mock = true) {
        return request({
            url: '/roles/list',
            method: 'get',
            data: params,
            mock: mock
        })
    },
    operateRole (params, mock = true) {
        return request({
            url: '/roles/operate',
            method: 'post',
            data: params,
            mock: mock
        })
    },
    updateRolePermission (params, mock = true) {
        return request({
            url: '/roles/update/permission',
            method: 'post',
            data: params,
            mock: mock
        })
    },
    roleDelete (params, mock = true) {
        return request({
            url: '/roles/delete',
            method: 'delete',
            data: params,
            mock: mock
        })
    },
    getAllDept(params, mock = true) {
        return request({
            url: '/dept/list',
            method: 'get',
            data: params,
            mock: mock
        })
    },

    operateUser(params, mock = true) {
        return request({
            url: '/users/operate',
            method: 'post',
            data: params,
            mock: false
        })
    },
    getLeaveList(params, mock = true) {
        return request({
            url: '/leave/list',
            method: 'get',
            data: params,
            mock: mock
        })
    },
    addLeave(params, mock = true) {
        return request({
            url: '/leave/add',
            method: 'post',
            data: params,
            mock: mock
        })
    },
    deleteLeave(params, mock = true) {
        return request({
            url: '/leave/delete',
            method: 'delete',
            data: params,
            mock: mock
        })
    },
}
